package com.liurq.springcloud.controller;

import com.liurq.springcloud.service.PaymentFeignService;
import org.liurq.springcloud.entites.CommonResult;
import org.liurq.springcloud.entites.Payment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderFeignController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id)
    {
        return paymentFeignService.get(id);
    }

    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTimeout()
    {
        return paymentFeignService.paymentFeignTimeout();
    }

    @GetMapping(value = "/consumer/zipkin")
    public String zipkin()
    {
        return paymentFeignService.zipkin();
    }
}
